home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Blind_Freddy;
- {$T APPLPUTE} { Set application ID }
- {$B+}
- {$R Blind_Freddy.rscs}
- {$U-}
-
- USES pasinout, memtypes, quickdraw, osintf, toolintf, packintf,
- speechintf;
-
- TYPE
- bytes = PACKED ARRAY [1..256] OF char;
- byteptr = ^bytes;
-
- VAR
- thefile: appfile;
- myfinfo: finfo;
- myoserr: oserr;
- myrefnum: integer;
- mycount, mymessage, x, y: integer;
- speaking, readme: boolean;
- dummy: longint;
- mypoint: point;
- mytypelist: sftypelist;
- f: text;
- tempstr: str255;
- ch: char;
- myreply: sfreply;
-
- PROCEDURE speakme(speakstr: str255);
-
- VAR
- i, len: integer;
- linein: str255; {the English text to be spoken}
- lineptr: byteptr; {a pointer to the text}
- output: handle; {Handle to phonetic string}
- thespeech: speechhandle; {Handle to speech globals}
-
- BEGIN
- IF speaking THEN
- BEGIN
- i := speechon('', thespeech);
- IF (i <> 0) THEN
- BEGIN
- speaking := false;
- sysbeep(20);
- sysbeep(20);
- sysbeep(20);
- END;
- IF (i <> 0) THEN exit;
- linein := speakstr + '##';
- linein[0]:=',';
- lineptr := @linein;
- output := newhandle(0);
- hlock(output);
- i := reader(thespeech, pointer(lineptr), 256, output);
- i := macintalk(thespeech, output);
- speechoff(thespeech);
- hunlock(output);
- disposhandle(output);
- END;
- END;
-
- PROCEDURE displayfile;
-
- BEGIN
- WHILE NOT eoln(f) and not button DO
- BEGIN
- read(f, ch);
- tempstr := tempstr + ch;
- systemtask;
- END;
- readln(f);
- speakme(tempstr);
- tempstr := ' ';
- END;
-
- BEGIN
- readme := true;
- speaking := true;
- systemtask;
- countappfiles(mymessage, mycount);
- getappfiles(mycount, thefile);
- myoserr := getfinfo(thefile.fname, thefile.vrefnum, myfinfo);
- IF mycount = 0 THEN
- BEGIN
- sysbeep(20);
- sysbeep(20);
- sysbeep(20);
- readme := false;
- END
- ELSE
- BEGIN
- systemtask;
- systemtask;
- END;
- IF readme AND ((myfinfo.fdtype = 'TEXT') OR (myfinfo.fdtype =
- 'ttro')) THEN
- BEGIN
- tempstr := ' ';
- myoserr := setvol(NIL, thefile.vrefnum);
- speakme('Hold down the mouse button to Quit');
- speakme('Hello, This is a file called ' + thefile.fname);
- reset(f, thefile.fname);
- REPEAT
- systemtask;
- displayfile;
- systemtask;
- UNTIL (eof(f) OR button);
- close(f);
- END;
- clrappfiles(mycount);
- END.
-